<template lang="html">
	<div :class="$style.mheader">
		<Mheader/>
		<ul :class="$style.list">
			<li :class="[$style.listItem,{navActive:navIndex===index}]" v-for="(item,index) in navData" :key="index" @click.stop="clickNav(index,item)">
				<p>{{item.title}}</p>
			</li>
		</ul>
	</div>
</template>
<script>
	import Mheader from './mheader';
	export default {
		data() {
			return {
				navIndex: 0,
				navData: [
					{href:'mview',params:'1',title:'首页'},
					{href:'mview',params:'2',title:'男频'},
					{href:'mview',params:'3',title:'女频'},
					{href:'mview',params:'4',title:'漫画'},
					{href:'mview',params:'5',title:'出版'}
				],
			}
		},
		components: {
			Mheader,
		},
		methods: {
			clickNav(index,object) {
				this.navIndex = index;
				//路由跳转
				this.$router.push({name:object.href,query:{params:object.params}});
			}
		}
	}
</script>
<style lang="scss" module>
	@import "../../../css/element.scss";
	.mheader {
		width: 100%;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 1000;
		background: #ffffff;
		.list {
			@include list(row);
			justify-content: space-around;
			align-items: center;
			height: 90px;
			line-height: 90px;
			.listItem {
				flex:1;
				font-size: 32px;
				text-align: center;
				p {
					width: 75%;
					margin: auto;
				}
			}
		}
	}
</style>